package chpt08;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.File;

public class FileOutputStreamTest {

	public static void main(String[] args) {
		String str = "Hello Java I/O Stream!";
		String filename = "test.txt";
		try (FileOutputStream out = new FileOutputStream(new File(filename))){
			byte[] contents = str.getBytes();
			out.write(contents);
		}catch(IOException e) {
			e.printStackTrace();
		}		
	}
}
